home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
mac
/
LOGIC Apple II 5.25" Library - ProDOS
/
PRO018.dsk
/
BOOTABLE.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
3KB
|
69 lines
100 REM program to make
110 REM a bootable disk.
120 REM
130 REM by Keith Falkner
140 REM
150 PRINT CHR$(21): TEXT : HOME
160 INVERSE : PRINT "BOOTABLE";: NORMAL
170 PRINT " - makes a disk able to boot."
180 PRINT : POKE 34,2
190 LOMEM: PEEK(116) *256 -6144
200 A = PEEK(175) +256 * PEEK(176)
210 W = PEEK(105) +256 * PEEK(106) -A
220 FP$ = "PRODOS"
230 FB$ = "BASIC.SYSTEM"
240 PRINT : PRINT "I can copy the files "FP$
250 PRINT "and "FB$
260 PRINT "from a disk which contains them,"
270 PRINT "to a disk which needs those files,"
280 PRINT "so that the target disk can 'boot'."
290 PRINT : PRINT "If you want to do this,"
300 PRINT "put a bootable disk in drive 1."
310 PRINT : PRINT "Shall we proceed";
320 GOSUB 730: IF NO GOTO 710
330 D$ = CHR$(4): REM ctrl-D
340 PRINT D$"PREFIX,D1"
350 PRINT D$"PREFIX": INPUT P$
360 PRINT D$"OPEN"P$",TDIR"
370 PRINT D$"READ"P$
380 INPUT Z$,Z$,Z$
390 INPUT Z$: IF Z$ = "" GOTO 670
400 IF ASC(Z$) = ASC("*") THEN Z$ = MID$ (Z$,2)
410 F$ = LEFT$(Z$,15)
420 IF RIGHT$(F$,1) = " " THEN F$ = MID$ (F$,1, LEN(F$) -1): GOTO 420
430 S = VAL( MID$ (Z$,63)): REM size
440 IF YP = 0 THEN IF F$ = FP$ THEN YP = 1:SP = S
450 IF YB = 0 THEN IF F$ = FB$ THEN YB = 1:SB = S
460 IF YP *YB = 0 GOTO 390
470 IF W <SP +SB THEN PRINT "OOPS! I need "SP +SB -W" more bytes of memory.": GOTO 670
480 PRINT D$"CLOSE"P$
490 PRINT D$"BLOAD"FP$",TSYS,A"A
500 PRINT D$"BLOAD"FB$",TSYS,A"A +SP
510 PRINT : PRINT : PRINT CHR$(7)"OK, now put your disk in the same drive"
520 PRINT "and the system will be written on it."
530 PRINT : PRINT "I'm ready. Are you";
540 GOSUB 730: IF NO GOTO 710
550 PRINT D$"PREFIX,D1"
560 PRINT D$"PREFIX": INPUT N$
570 IF N$ = P$ THEN PRINT : PRINT CHR$(7);: INVERSE : PRINT "YOU DID NOT CHANGE DISKS!": NORMAL : GOTO 510
580 PRINT D$"CREATE"FP$",TSYS"
590 PRINT D$"BSAVE"FP$",TSYS,A"A",L"SP
600 PRINT D$"LOCK"FP$
610 PRINT D$"CREATE"FB$",TSYS"
620 PRINT D$"BSAVE"FB$",TSYS,A"A +SP",L"SB
630 PRINT D$"LOCK"FB$
640 PRINT : PRINT D$"CAT": PRINT
650 PRINT "I did it, and I'd like to do it again!"
660 P$ = N$: GOTO 510
670 PRINT D$"CLOSE"
680 IF SP = 0 THEN PRINT : PRINT "OOPS! no file "FP$"."
690 IF SB = 0 THEN PRINT : PRINT "OOPS! no file "FB$"."
700 PRINT CHR$(7)
710 PRINT : PRINT : PRINT "Finished!"
720 TEXT : VTAB 23: END
730 PRINT "? (Y or N): ";
740 POKE 49168,0: GET K$
750 YES = (K$ = "y") +(K$ = "Y")
760 NO = (K$ = "n") +(K$ = "N")
770 IF NO = YES THEN PRINT CHR$(7);: GOTO 740
780 PRINT K$: RETURN